home *** CD-ROM | disk | FTP | other *** search
- Path: nwlink.com!usenet
- From: jlim@nwlink.com (John Lim)
- Newsgroups: comp.lang.c
- Subject: Pointers to Linked Lists
- Date: Sun, 11 Feb 1996 04:45:14 GMT
- Organization: Northwest Link
- Message-ID: <4fjs0b$7sb@texas.nwlink.com>
- NNTP-Posting-Host: port19.annex2.nwlink.com
- X-Newsreader: Forte Free Agent 1.0.82
-
- please help me with this pointer question
-
-
- typedef struct node
- {
- generic_ptr data; (generic_ptr is a pointer to void)
- struct node *next;
- } node, *list;
-
- so i know that list is a pointer to a node
-
- in main i have the lines
-
- list pairlist;
-
- adtInitializeList (&pair_list) (adtInitializeList is a library
- function which i have to write)
-
- in libadt.c
-
- adtInitializeList (list *pL)
- {
- *pL=NULL;
- return OK:
- }
-
- so my questions are:
- - isn't pL a pointer to a pointer to a node? because it is of type
- list and list is a pointer to a node
- -if so why would one need to use this? why can't you just use
- adtInitializeList (list pL)?
-
- any help would be appreciated
- john lim (jlim@nwlink.com)
-
-